#include <iostream>
using namespace std;

int main()
{
    string number;
    long long sum;
    while(cin >> number)
    {
        for(int i=0; i<number.length(); i++)
        {
            sum += (number[i] -48);
        }
        cout << sum << endl;
        sum = 0;
    }
    return 0;
}